#pragma once

// ------ include bsp_user.h at first ------
// ---- hal
#include <stm32g4xx_hal.h>
// ---- chip peripheral
#include <main.h>
// ------ board peripheral
#include <bsp/clock.h>
// #include <bsp/io.h>
#include <bsp/malloc.h>
#include <cmsis_os.h>

#if defined(__cplusplus)
namespace bsp {
void Init();
}
#endif

// ------ macro that displays what onboard resources are available. ------

// ---- DWT
#define BSP_HAS_DWT 1

// ---- CAN
#define BSP_HAS_CAN1 0
#define BSP_HAS_CAN2 0
#define BSP_HAS_CAN3 0

#define BSP_HAS_CAN_FD1 1
#define BSP_HAS_CAN_FD2 1
#define BSP_HAS_CAN_FD3 1


// ---- UART
#define BSP_HAS_UART1 0
#define BSP_HAS_UART2 0
#define BSP_HAS_UART3 0
#define BSP_HAS_UARTx (BSP_HAS_UART1 or BSP_HAS_UART2 or BSP_HAS_UART2)

#define BSP_HAS_USART1 1
#define BSP_HAS_USART2 1
#define BSP_HAS_USART3 1
#define BSP_HAS_USARTx (BSP_HAS_USART1 or BSP_HAS_USART2 or BSP_HAS_USART3)

// ---- RTT
#define BSP_HAS_RTT 0
#define BSP_HAS_SHELL 0

// ---- USB
#define BSP_HAS_USB 1

// ---- Timer
#define BSP_HAS_HARD_TIMER 1
